home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / diff / dist / Makefile < prev    next >
Encoding:
Makefile  |  1990-02-19  |  3.0 KB  |  96 lines

  1. # Makefile for GNU DIFF
  2. # Copyright (C) 1988, 1989 Free Software Foundation, Inc.
  3.  
  4. # This file is part of GNU DIFF.
  5.  
  6. # GNU DIFF is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 1, or (at your option)
  9. # any later version.
  10. # GNU DIFF is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GNU DIFF; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19. # You can compile this with ordinary cc as well,
  20. # but gcc makes it faster.
  21. # Also, gcc supports -O and -g together.
  22. CC=gcc -O
  23. CFLAGS = -g
  24. INSTALL = install
  25.  
  26. # On system V, enable these three lines:
  27. # CFLAGS = -g -DUSG
  28. # LIBS = -lPW
  29. # INSTALL = cp
  30. # (If you compile with GCC, you don't need to define LIBS.)
  31. # And, depending on the names and contents of your header files,
  32. # add either -DHAVE_NDIR or -DHAVE_DIRECT or both to CFLAGS.
  33. # Add -DHAVE_NDIR to CFLAGS if your system used ndir.h instead of dirent.h
  34. # Add -DHAVE_DIRECT to CFLAGS if your system uses 'struct direct' instead of
  35. # 'struct dirent' (this is the case at least with one add-on ndir library).
  36.  
  37. bindir=/usr/local/bin
  38. prefix=
  39.  
  40. # All source files
  41. srcs=diff.c analyze.c io.c context.c ed.c normal.c ifdef.c util.c dir.c \
  42.     version.c diff.h regex.c regex.h limits.h diff3.c \
  43.     getopt.c getopt1.c getopt.h
  44. # Object files for diff only.
  45. objs=$(archpfx)diff.o $(archpfx)analyze.o $(archpfx)io.o $(archpfx)context.o \
  46.      $(archpfx)ed.o $(archpfx)normal.o $(archpfx)util.o $(archpfx)dir.o \
  47.      $(archpfx)regex.o $(archpfx)ifdef.o $(archpfx)version.o \
  48.      $(archpfx)getopt.o $(archpfx)getopt1.o
  49. tapefiles = $(srcs) README diagmeet.note Makefile COPYING ChangeLog
  50.  
  51. all: $(archpfx)diff $(archpfx)diff3
  52.  
  53. $(archpfx)diff3: $(archpfx)diff3.o
  54.     $(CC) -o $(archpfx)diff3 $(CFLAGS) $(LDFLAGS) $(archpfx)diff3.o $(LIBS)
  55.  
  56. $(archpfx)diff: $(objs)
  57.     $(CC) -o $(archpfx)diff $(CFLAGS) $(LDFLAGS) $(objs) $(LIBS)
  58.  
  59. $(objs): diff.h
  60.  
  61. $(archpfx)context.o $(archpfx)diff.o: regex.h
  62.  
  63. $(archpfx)diff3.o: diff3.c
  64.     $(CC) -c $(CFLAGS) -DDIFF_PROGRAM=\"$(bindir)/diff\" diff3.c \
  65.  $(OUTPUT_OPTION)
  66.  
  67. clean:
  68.     rm -f *.o $(archpfx)diff $(archpfx)diff3 diff.tar diff.tar.Z
  69.  
  70. install: install-diff install-diff3
  71.  
  72. install-diff: $(prefix)$(bindir)/diff
  73.  
  74. $(prefix)$(bindir)/diff: $(archpfx)diff
  75.     $(INSTALL) $(archpfx)diff $(prefix)$(bindir)/diff
  76.  
  77. install-diff3: $(prefix)$(bindir)/diff3
  78.  
  79. $(prefix)$(bindir)/diff3: $(archpfx)diff3
  80.     $(INSTALL) $(archpfx)diff3 $(prefix)$(bindir)/diff3
  81.  
  82. diff.tar: $(tapefiles)
  83.     mkdir tmp
  84.     mkdir tmp/diff
  85.     -ln $(tapefiles) tmp/diff
  86.     for file in $(tapefiles); do \
  87.         if [ ! -r tmp/diff/$$file ]; then cp $$file tmp/diff; fi \
  88.     done
  89.     cd tmp; tar cf ../diff.tar diff
  90.     rm -rf tmp
  91.  
  92. diff.tar.Z: diff.tar
  93.     compress < diff.tar > diff.tar.Z
  94.